package Heap;

import java.util.PriorityQueue;

/**
 * User:辰柒
 * Date:2022-10-12
 * Time:10:11
 */

class Student implements Comparable<Student>{
    int age;

    public Student(int age){
        this.age = age;
    }


    @Override
    public int compareTo(Student o) {
        return this.age - o.age;
    }
}
public class Test {
    public static void main(String[] args) {
        PriorityQueue<Student> priorityQueue = new PriorityQueue<>();
        priorityQueue.offer(new Student(10));
        priorityQueue.offer(new Student(20));

    }

    public static void main1(String[] args) {
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();
        priorityQueue.offer(30);
        priorityQueue.offer(20);
        priorityQueue.offer(10);
        System.out.println(priorityQueue.poll());//输出10 默认小堆
//        TestHeap testHeap = new TestHeap();
//        int[] array = { 27,15,19,18,28,34,65,49,25,37 };
//        testHeap.initElem(array);
//        testHeap.createHeap();
//        System.out.println("faasafsasafa");
//        //testHeap.offer(50);
//        System.out.println(testHeap.pop());
//        System.out.println("断点处");
    }
}
